/*
 *	xmalloc.h
 *	  part of the xlibrary by SunDEV (http://sundev.890m.com)
 *
 *	Changelog :
 *	  ##-##-## : First public release
 *
 */

#ifndef _XMALLOC_H
#define _XMALLOC_H

void *_xmalloc(size_t size, const char *text, u32 line);
void *_xcalloc(size_t num, size_t size, const char *text, u32 line);
void *_xrealloc(void *ptr, size_t size, const char *text, u32 line);
void _xfree(void *ptr, const char *text, u32 line);

void *xmalloc(size_t size);
void *xcalloc(size_t num, size_t size);
void *xrealloc(void *ptr, size_t size);
void xfree(void *ptr);

#define xmalloc(s)		_xmalloc((s), __func__, __LINE__)
#define xcalloc(n, t)	_xcalloc((n), (t), __func__, __LINE__)
#define xrealloc(p, s)	_xrealloc((p), (s), __func__, __LINE__)
#define xfree(a)		_xfree((a), __func__, __LINE__)

#endif

